package com.jintian.smart.kernel.orm.mapper;

import java.util.List;
import java.util.Map;

import com.jintian.smart.kernel.orm.mapper.internal.SimplePageQueryAMI;
import com.jintian.smart.kernel.orm.mapper.internal.TemplatePageQueryAMI;
import com.jintian.smart.kernel.orm.mapper.internal.UpdateTemplate2AMI;
import org.beetl.sql.core.page.PageRequest;
import org.beetl.sql.core.page.PageResult;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.AutoMapper;

public interface IBaseExtMapper<T> extends BaseMapper<T> {
    /**
     * 根据一批主键查询
     *
     * @return
     */
    @AutoMapper(TemplatePageQueryAMI.class)
    List<T> templatePageQuery(T template, PageRequest<T> request);

    /**
     * 简单分页查询
     *
     * @param query
     * @return
     */
    @AutoMapper(SimplePageQueryAMI.class)
    PageResult<T> simpleQuery(PageRequest<T> query);

    /**
     * 只更新Map包含的属性，支持空值更新。必须包含主键属性和版本属性(如果存在)
     *
     * @param template
     * @return
     */
    @AutoMapper(UpdateTemplate2AMI.class)
    boolean updateTemplate2ById(Map<String, Object> template);
}
